package com.bigger.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class BusinessMP {
    private final static DateTimeFormatter formatter =DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    private Long id;
    // 业务名称
    private String name;
    private String image;
    // 业务价格
    private Double price;
    // 业务状态
    private Integer status;
    // 业务信息
    private String info;
    // 创建时间
    private String createTime;
    // 更新时间
    private String updateTime;
    // 创建用户
    private Long createUser;
    // 更新用户
    private Long updateUser;
    public BusinessMP(Business business){
        this.id= business.getId();
        this.name=business.getName();
        this.image= business.getImage();
        this.price= business.getPrice();
        this.status=business.getStatus();
        this.info= business.getInfo();
        this.createTime= formatter.format(business.getCreateTime());
        this.updateTime=formatter.format(business.getUpdateTime());
        this.createUser= business.getCreateUser();
        this.updateUser= business.getUpdateUser();
    }
}
